home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AEMail 2.40
/
AEMail v2.40.iso
/
arexx
/
html2.readme
< prev
next >
Wrap
Text File
|
2000-03-11
|
10KB
|
249 lines
html2.readme
THIS SCRIPT WILL RUN ON BOTH REGISTERED AND UNREGISTERED COPIES OF AEMAIL
The html2.aem script, like the html.aem script, is used to read html
attachments in email or to display a web address contained within a
message. The difference between html.aem and html2.aem is that html2.aem
will allow you to select the browser you want to use if you have multiple
browsers.
You can also assign this script to the Web Addr exit to select your browser
without bringing up the clip window when you double click on a web address
embedded in the message.
The html2.aem script is currently set up to select between IBrowse 1.x,
Ibrowse 2.x, and AWeb3. The reason both IBrowse 1.x and IBrowse 2.x are
specified is that IBrowse 2.x lacks some of the features of IBrowse 1.x
but includes additional features like JAVA script.
It can also be attached to a function key or a menu item and used to
activate your browser to display a web address that is contained within a
message.
The script requires the "rexxsupport.library" to run. This library
normally comes with your Amiga at version 2.1 or greater.
When first activated the script displays a list of browsers that you might
want to use. The default list looks like this:
IBROWSE2
IBROWSE1
AWEB3
You can modify this list by changing the line beginning with "browlst ="
in the script to include the browsers you want. You will also have to
modify the IF ... ELSE sequence that establishes the directory (wwwdir),
program (wwwprog), and ARexx port (wwwport) for any selected browser (see
below under "HOW TO IMPLEMENT").
When reading HTML attachments, the script uses your browser to read the
HTML file. This script can use either IBrowse or AWeb to read and display
the html document. The script will have to be modified to use a different
browser.
Also in this directory is an alternate mailcap file which is required for
displaying the html document. You will notice in the mailcap file the
first line which is as follows:
text/html; "run >NIL: rx html.aem %s"
This line calls the html.aem script to display the html attachment with
your browser. To use the mailcap, the script, "html2.aem", should be
moved to your REXX: directory and renamed "html.aem". Notice that the
call line says "run". This is required to allow the script to become
detached from AEMail so that ARexx commands can be directed back to
AEMail. If the "run" is not present, AEMail will become frozen when you
attempt to display the document.
You can move this mailcap to your mail directory when you install AEMail
(if you install at the "expert" level) or, using the Viewer page of the
Configuration screen, you can create a "text/html" statement in your
mailcap. If you use the Viewer page, you do not have to move the script to
the REXX: directory since you can specify the full path name in the rexx
script call. In this case you can specify AEMail2:AEMail/ARexx/html2.aem
HOW TO IMPLEMENT
----------------
Copy the mailcap file over your existing mailcap file or create a mailcap
entry for "text/html" in your mailcap using the Viewer page of the
Configuration Setup Window.
Move the html2.aem script to either your program directory or the REXX:
directory and rename it "html.aem". If you create your own mailcap with
the Viewer page of the Configuration Setup, you can create a line for:
text/html
and locate the "html2.aem" ARexx script using the file requester in
AEMail's ARexx drawer. Be sure the full path is specified. If you do
this you do not have to move the html2.aem script.
The script is designed specifically for IBrowse or AWeb and must be
modified if another browser is used.
At the beginning of the script you will notice the section beginning:
IF (file = "") THEN DO
this is used to pick up the variable (the GETVAR statement) that is the URL
when you are activating a web address embedded in a message. If you are
reading an HTML attachment, the local file address used is passed to the
script so that "file" will not be empty which bypasses these statements.
Since IBrowse doesn't normally create an assignment for it's program
directory, you will have to add an assignment for the IBrowse program
directory to your startup sequence. If you are using both IBrowse 1.x and
IBrowse 2.x, the assignments could be IBROWSE1 for the IBrowse 1.x
directory and IBROWSE2 for the IBrowse 2.x directory.
Note, however, that the assignment for AWeb3 is all in upper case letters.
Even though the assign statement specifies upper and lower case letters,
you have to specify the assign with all caps for ARexx to properly find
it.
If you wish to use another browser, you will have to modify the browlst =
statement and add an ASSIGN for that browser's program directory. Then
add the following statements:
IF browser = "xxxxx" THEN
DO
wwwdir = "xxxxx"
wwwprog = "xxxxx:prog"
wwwport = "ppppp"
END
where xxxxx is the name used in your ASSIGN and in the browlst =
statement, prog is the name of your browser program, and ppppp is the
ARexx prort for that browser.
The section of the script that begins with
IF (wwwport = "AWEB." THEN
is used to obtain the port number for AWEB. If you are using AWeb and AWEB
is not running this will default to AWEB.1
The section beginning:
IF ~ SHOW('P', wwwport) THEN
is used to load your browser if is not already loaded.
The line:
olddir = PRAGMA('D', wwwdir)
is used to change the directory to the directory containing your program.
This is necessary with some browsers (especially IBROWSE) so that they can
find the modules and files they need. IBROWSE gurus in some instance if
this statement is not there.
The section beginning:
IF (file2 == 'T:AMtemp') THEN DO
is used to set up the URL call for a local file if the file name "T:AMtemp"
is passed to the script. This is the standard name and place AEMail uses
for temporarily storing attachment files. The name must be changed to
t:amtemp.html since browsers require the .html suffix on the name. The
full call that browsers use is:
"file://localhost/t:amtemp.html"
which is stored in the variable "file".
The final part of the script:
ADDRESS VALUE wwwport
IF (wwwport = "IBROWSE") THEN DO
"INFO SCREEN"
ADDRESS AEMAIL1 SCREENTOFRONT result
"GOTOURL" file
END
ELSE DO
"SCREENTOFRONT"
"OPEN" file
END
causes things to happen a bit differently if you are running IBROWSE versus
AWEB. The statement:
ADDRESS VALUE wwwport
sets your ARexx port to the correct port name. If the port was "IBROWSE"
then this action takes place:
"INFO SCREEN"
This obtains the public screen name for your browser. Since IBROWSE uses
MUI, this is a standard stament for any program using MUI. The next
statement:
ADDRESS AEMAIL1 SCREENTOFRONT result
is a call to AEMail to switch your browser's screen to the front. "result"
is the screen named obtained through MUI of the browser's public screen.
The statement:
"GOTOURL" file
is an ARexx call to IBROWSE to display the html document.
If your browser is not IBROWSE, then it is assumed to be AWEB. The
statements after ELSE are used for AWEB. Since AWEB does not use MUI, it
has its own statement for bring the AWEB screen to the front. This is:
"SCREENTOFRONT"
Then the call to AWEB to display your URL is "OPEN" rather than "GOTOURL"
HOW TO USE
----------
When you get an email with an html attachment (or text body) call up your
attachment requester, select the appropriate attachment (it will say
"text/html"), and click on VIEW. Select the browser that you want called
that is listed in the listview display. Your browser will be loaded (if
it is not already loaded) and the page will be displayed. You should have
an open connection to your Internet server when you call your browser
since many html attachments obtain information over the internet (such as
graphic images).
When you are done viewing the html document you should either close the
browser or switch it's screen to the back to re-display the AEMail screen.
For browsers that open on the Workbench, there is an AREXX script called
AEMAIL_TOFRONT.aem. This script will automatically close your browser and
bring the AEMail screen to the front (see the AEMAIL_TOFRONT.readme) and
must be installed in the AREXX portion of your browser.
To use this script to display embedded web addresses in a document you
will have to bind the "html2.aem" script to a function key in AEMail and
assign a menu title. To do this call up the ARexx page of the AEMail
configuration screen and select the function key you want the "html2.aem"
script bound to. Enter the script name (full path name) in the string
gadget. Be sure you have AREXX selected in the cycle gadget. You can use
the file folder glyph to call up the file requester to locate the script.
Then, if you want a menu item, enter a menu title in the "Menu Title"
string gadget. Then save the configuration.
When you receive a message with an embedded web address just double click
on the line containing the web address. The web address will appear in
the Clip window. Now either hit the function key that you bound the
html.aem script to or select the menu item indicate by the "Menu Title"
and the web page will be called up. You will, of course, have to be
connected to your Internet provider for this to work.
If for any reason your browser can not be loaded, multiview will be called
to display the document as a text document.